package com.example.f8399.testdemo.activity;

import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.example.f8399.testdemo.BaseActivity;
import com.example.f8399.testdemo.R;
import com.example.f8399.testdemo.databinding.ActivityViewSwitcherBinding;

public class ViewSwitcherActivity extends BaseActivity {

    ActivityViewSwitcherBinding mBinding;
    private boolean isF = true;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       mBinding = DataBindingUtil. setContentView(this,R.layout.activity_view_switcher);
       mBinding.setAc(this);


    }

    public void changeImage(View view) {
//        mBinding.viewSwitcher2.showNext();
        if (isF) {
            isF = false;
            mBinding.viewSwitcher2.setDisplayedChild(1);
        }else {
            isF = true;
            mBinding.viewSwitcher2.setDisplayedChild(0);
        }
    }
}
